package com.lifeng.serivce.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lifeng.domain.Permission;
import com.lifeng.domain.PermissionExample;
import com.lifeng.domain.PermissionExample.Criteria;
import com.lifeng.domain.User;
import com.lifeng.mapper.PermissionMapper;
import com.lifeng.mapper.UserMapper;
import com.lifeng.serivce.UserService;
@Service
@Transactional
public class UserServiceImpl implements UserService{
	@Autowired
	private UserMapper userMapper;
	
	@Autowired
	private PermissionMapper permissionMapper;
	@Override
	
	public List<User> queryAll() {
		return userMapper.queryAll();
	}
	@Override
	public List<Permission> permissionAll() {
		PermissionExample p = new PermissionExample();
		Criteria c = p.createCriteria();
		c.andNameLike("%修%");
		c.andPidEqualTo(3);
		return permissionMapper.selectByExample(p);
	}

}
